package com.nine.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName t_user_info
 */
@TableName(value = "t_user_info")
@Data
public class UserInfo implements Serializable {

	private static final long serialVersionUID = 1L;
	/**
	 *
	 */
	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;

	/**
	 *
	 */
	@TableField(value = "nickname")
	private String nickname;

	/**
	 *
	 */
	@TableField(value = "password")
	private String password;

	/**
	 *
	 */
	@TableField(value = "sex")
	private String sex;

	/**
	 *
	 */
	@TableField(value = "phone")
	private String phone;

	/**
	 *
	 */
	@TableField(value = "email")
	private String email;

	/**
	 *
	 */
	@TableField(value = "address")
	private String address;

	// 处理前端传递后端的日期格式
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField(value = "create_time")
	private Date createTime;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@TableField(value = "update_time")
	private Date updateTime;

	@TableField(exist = false)
	private UserImage userImage;

	@TableField(exist = false)
	private UserContract userContract;

}